Optimal. Leaf size=171 \[ \frac {15 a^2 x}{64}-\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 171, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212}
\begin {gather*} -\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))}+\frac {15 a^2 x}{64} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 212
Rule 3568
Rubi steps
\begin {align*} \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx &=-\frac {\left (i a^9\right ) \text {Subst}\left (\int \frac {1}{(a-x)^5 (a+x)^3} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^9\right ) \text {Subst}\left (\int \left (\frac {1}{8 a^3 (a-x)^5}+\frac {3}{16 a^4 (a-x)^4}+\frac {3}{16 a^5 (a-x)^3}+\frac {5}{32 a^6 (a-x)^2}+\frac {1}{32 a^5 (a+x)^3}+\frac {5}{64 a^6 (a+x)^2}+\frac {15}{64 a^6 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))}-\frac {\left (15 i a^3\right ) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{64 d}\\ &=\frac {15 a^2 x}{64}-\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.45, size = 138, normalized size = 0.81 \begin {gather*} \frac {a^2 (-80 i+30 (-i+4 d x) \cos (2 (c+d x))+16 i \cos (4 (c+d x))+i \cos (6 (c+d x))+30 \sin (2 (c+d x))-120 i d x \sin (2 (c+d x))+32 \sin (4 (c+d x))+3 \sin (6 (c+d x))) (\cos (2 (c+2 d x))+i \sin (2 (c+2 d x)))}{512 d (\cos (d x)+i \sin (d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.23, size = 141, normalized size = 0.82
method | result | size |
risch | \(\frac {15 a^{2} x}{64}-\frac {i a^{2} {\mathrm e}^{8 i \left (d x +c \right )}}{512 d}-\frac {i a^{2} {\mathrm e}^{6 i \left (d x +c \right )}}{64 d}-\frac {7 i a^{2} \cos \left (4 d x +4 c \right )}{128 d}+\frac {a^{2} \sin \left (4 d x +4 c \right )}{16 d}-\frac {7 i a^{2} \cos \left (2 d x +2 c \right )}{64 d}+\frac {13 a^{2} \sin \left (2 d x +2 c \right )}{64 d}\) | \(114\) |
derivativedivides | \(\frac {-a^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{7}\left (d x +c \right )\right )}{8}+\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{48}+\frac {5 d x}{128}+\frac {5 c}{128}\right )-\frac {i a^{2} \left (\cos ^{8}\left (d x +c \right )\right )}{4}+a^{2} \left (\frac {\left (\cos ^{7}\left (d x +c \right )+\frac {7 \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {35 \left (\cos ^{3}\left (d x +c \right )\right )}{24}+\frac {35 \cos \left (d x +c \right )}{16}\right ) \sin \left (d x +c \right )}{8}+\frac {35 d x}{128}+\frac {35 c}{128}\right )}{d}\) | \(141\) |
default | \(\frac {-a^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{7}\left (d x +c \right )\right )}{8}+\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{48}+\frac {5 d x}{128}+\frac {5 c}{128}\right )-\frac {i a^{2} \left (\cos ^{8}\left (d x +c \right )\right )}{4}+a^{2} \left (\frac {\left (\cos ^{7}\left (d x +c \right )+\frac {7 \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {35 \left (\cos ^{3}\left (d x +c \right )\right )}{24}+\frac {35 \cos \left (d x +c \right )}{16}\right ) \sin \left (d x +c \right )}{8}+\frac {35 d x}{128}+\frac {35 c}{128}\right )}{d}\) | \(141\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 115, normalized size = 0.67 \begin {gather*} \frac {15 \, {\left (d x + c\right )} a^{2} + \frac {15 \, a^{2} \tan \left (d x + c\right )^{7} + 55 \, a^{2} \tan \left (d x + c\right )^{5} + 73 \, a^{2} \tan \left (d x + c\right )^{3} + 49 \, a^{2} \tan \left (d x + c\right ) - 16 i \, a^{2}}{\tan \left (d x + c\right )^{8} + 4 \, \tan \left (d x + c\right )^{6} + 6 \, \tan \left (d x + c\right )^{4} + 4 \, \tan \left (d x + c\right )^{2} + 1}}{64 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 106, normalized size = 0.62 \begin {gather*} \frac {{\left (120 \, a^{2} d x e^{\left (4 i \, d x + 4 i \, c\right )} - i \, a^{2} e^{\left (12 i \, d x + 12 i \, c\right )} - 8 i \, a^{2} e^{\left (10 i \, d x + 10 i \, c\right )} - 30 i \, a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} - 80 i \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + 24 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i \, a^{2}\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{512 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.29, size = 270, normalized size = 1.58 \begin {gather*} \frac {15 a^{2} x}{64} + \begin {cases} \frac {\left (- 8589934592 i a^{2} d^{5} e^{14 i c} e^{8 i d x} - 68719476736 i a^{2} d^{5} e^{12 i c} e^{6 i d x} - 257698037760 i a^{2} d^{5} e^{10 i c} e^{4 i d x} - 687194767360 i a^{2} d^{5} e^{8 i c} e^{2 i d x} + 206158430208 i a^{2} d^{5} e^{4 i c} e^{- 2 i d x} + 17179869184 i a^{2} d^{5} e^{2 i c} e^{- 4 i d x}\right ) e^{- 6 i c}}{4398046511104 d^{6}} & \text {for}\: d^{6} e^{6 i c} \neq 0 \\x \left (- \frac {15 a^{2}}{64} + \frac {\left (a^{2} e^{12 i c} + 6 a^{2} e^{10 i c} + 15 a^{2} e^{8 i c} + 20 a^{2} e^{6 i c} + 15 a^{2} e^{4 i c} + 6 a^{2} e^{2 i c} + a^{2}\right ) e^{- 4 i c}}{64}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 342 vs. \(2 (133) = 266\).
time = 0.75, size = 342, normalized size = 2.00 \begin {gather*} \frac {120 \, a^{2} d x e^{\left (8 i \, d x + 4 i \, c\right )} + 240 \, a^{2} d x e^{\left (6 i \, d x + 2 i \, c\right )} + 120 \, a^{2} d x e^{\left (4 i \, d x\right )} + 8 i \, a^{2} e^{\left (8 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 16 i \, a^{2} e^{\left (6 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 8 i \, a^{2} e^{\left (4 i \, d x\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 8 i \, a^{2} e^{\left (8 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - 16 i \, a^{2} e^{\left (6 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - 8 i \, a^{2} e^{\left (4 i \, d x\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - i \, a^{2} e^{\left (16 i \, d x + 12 i \, c\right )} - 10 i \, a^{2} e^{\left (14 i \, d x + 10 i \, c\right )} - 47 i \, a^{2} e^{\left (12 i \, d x + 8 i \, c\right )} - 148 i \, a^{2} e^{\left (10 i \, d x + 6 i \, c\right )} - 190 i \, a^{2} e^{\left (8 i \, d x + 4 i \, c\right )} - 56 i \, a^{2} e^{\left (6 i \, d x + 2 i \, c\right )} + 28 i \, a^{2} e^{\left (2 i \, d x - 2 i \, c\right )} + 50 i \, a^{2} e^{\left (4 i \, d x\right )} + 2 i \, a^{2} e^{\left (-4 i \, c\right )}}{512 \, {\left (d e^{\left (8 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (6 i \, d x + 2 i \, c\right )} + d e^{\left (4 i \, d x\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.03, size = 144, normalized size = 0.84 \begin {gather*} \frac {15\,a^2\,x}{64}+\frac {\frac {15\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^5}{64}+\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^4\,15{}\mathrm {i}}{32}+\frac {5\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{32}+\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^2\,25{}\mathrm {i}}{32}-\frac {17\,a^2\,\mathrm {tan}\left (c+d\,x\right )}{64}+\frac {a^2\,1{}\mathrm {i}}{4}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^6+{\mathrm {tan}\left (c+d\,x\right )}^5\,2{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}-{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,2{}\mathrm {i}-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________